import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: fzykd
 * Date: 2022-11-10
 * Time: 21:15
 */

public class Demo2 {
    public static void main(String[] args) {
        //写文件
        try(OutputStream outputStream = new FileOutputStream("e:/hade/demo1")){
            //只能使用单引号
            //一次写一个
            outputStream.write('x');

            //一次写若干个
            byte[] bytes = new byte[]{99,100,111};
            outputStream.write(bytes);
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
